package com.syq.dao;

import com.syq.pojo.SysCategory;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

/**
 * @author Sun Yueqi
 * @version 1.00
 * @time 2022/5/29 22:52
 */
public interface SysCategoryMapper {

    @Insert("INSERT INTO sys_category (category_name,tx_command,rx_command,command_name,create_by) VALUES (#{categoryName},#{txCommand},#{rxCommand},#{commandName},#{createBy})")
    void addCategory(SysCategory sysCategory);

    @Select("SELECT * FROM sys_category")
    List<SysCategory> findAll();

    @Update("UPDATE  sys_category SET status =0 , update_time=#{updateTime} ,update_by =#{username} WHERE c_id =#{cId}")
    void deleteById(@Param("cId") Long cId, @Param("updateTime") Date updateTime, @Param("username")  String username);

}
